<?php

namespace app\common\validate\Product;

//引入底层的验证器类
use think\Validate;

/**
 * 订单商品验证器
 */
class Product extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'typeid' => 'require', //必填
        'name' => 'require', //必填
        'price' => 'require|gt:0', //必填
        'stock' => 'require|egt:0', //必填
        'thumbs' => 'require',
		'content' => 'require',
		'flag' => 'require',
    ];

    /**
     * 提示消息
     */
    protected $message = [
        'typeid.require'    => '商品类型未知',
        'name.require'    => '商品昵称未知',
        'price.require'    => '请填写商品单价',
        'stock.require'    => '请填写商品的库存',
        'thumbs.require'    => '商品昵称未知',
		'content.require'    => '商品内容未知',
		'flag.require'    => '商品状态未知',
    ];
    
    /**
     * 验证场景
     */
    protected $scene = [
    ];
}
